<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" dir="ltr">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>Android编译，打包、签名详细教程 - Jojol's blog - ITeye技术网站</title>
    <meta name="description" content="Android编译，打包、签名详细教程 Author：Jojol Data:2010.08.04 1.Android程序编译、打包、签名、发布的三种方式： 方式一：命令行手动编译打包 方式二：使用a ..." />
    <meta name="keywords" content="Android, Eclipse, Java, Ant, WordPress Android编译，打包、签名详细教程" />
    <link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon" />
    <link rel="search" type="application/opensearchdescription+xml" href="/open_search.xml" title="ITeye" />
    <link href="/rss" rel="alternate" title="Jojol's blog" type="application/rss+xml" />
    <link href="http://www.iteye.com/stylesheets/blog.css?1393920955" media="screen" rel="stylesheet" type="text/css" />
<link href="http://www.iteye.com/stylesheets/themes/blog/purple.css?1326191326" media="screen" rel="stylesheet" type="text/css" />
    <script src="http://www.iteye.com/javascripts/application.js?1358214518" type="text/javascript"></script>
    <script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-535605-1']);
  _gaq.push(['_setDomainName', 'iteye.com']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>


      <link href="http://www.iteye.com/javascripts/syntaxhighlighter/SyntaxHighlighter.css?1348819953" media="screen" rel="stylesheet" type="text/css" />
  <script src="http://www.iteye.com/javascripts/syntaxhighlighter/shCoreCommon.js?1325907333" type="text/javascript"></script>
<script src="http://www.iteye.com/javascripts/hotkey.js?1324994303" type="text/javascript"></script>
  <script src="http://www.iteye.com/javascripts/code_favorites.js?1358214518" type="text/javascript"></script>
<script src="http://www.iteye.com/javascripts/weiboshare.js?1324994303" type="text/javascript"></script>
  </head>
  <body>
    <div id="header">
      <div id="blog_site_nav">
  <a href="http://www.iteye.com/" class="homepage">首页</a>
  <a href="http://www.iteye.com/news">资讯</a>
  <a href="http://www.iteye.com/magazines">精华</a>
  <a href="http://www.iteye.com/forums">论坛</a>
  <a href="http://www.iteye.com/ask">问答</a>
  <a href="http://www.iteye.com/blogs">博客</a>
  <a href="http://www.iteye.com/blogs/subjects">专栏</a>
  <a href="http://www.iteye.com/groups">群组</a>
  <a href="#" onclick="return false;" id="msna"><u>更多</u> <small>▼</small></a>
  <div class="quick_menu" style="display:none;">
    <a target="_blank" href="http://job.iteye.com/iteye">招聘</a>
    <a href="http://www.iteye.com/search">搜索</a>
  </div>
</div>

      <div id="user_nav">
      <a href="/login" class="welcome" title="登录">您还未登录 !</a>
    <a href="/login">登录</a>
    <a href="/signup" class="nobg">注册</a>
  </div>

    </div>

    <div id="page">
      <div id="branding" class="clearfix">
        <div id="blog_name">
          <h1><a href="/">Jojol's blog</a></h1>
        </div>
        <div id='fd'></div>
        <div id="blog_navbar">
          <ul>
            <li class='blog_navbar_for'><a href="http://jojol-zhou.iteye.com"><strong>博客</strong></a></li>
            <li ><a href="/weibo">微博</a></li>
            <li ><a href="/album">相册</a></li>
            <li ><a href="/link">收藏</a></li>
            <li ><a href="/blog/guest_book">留言</a></li>
            <li ><a href="/blog/profile">关于我</a></li>
          </ul>
    
          <div class="search">
            <form action="/blog/search" method="get">
              <input class="search_text" id="query" name="query" style="margin-left: 10px;width: 110px;" type="text" value="" />
              <input class="submit_search" type="submit" value="" />
            </form>
          </div> 
          <div id="fd"></div>         
        </div>
      </div>
      
      <div id="content" class="clearfix">
        <div id="main">
          



          


<div class="h-entry" style='display:none'>
  <a href="http://jojol-zhou.iteye.com" class="p-author" target="_blank">jojol_zhou</a>
</div>


<div class="blog_main">
  <div class="blog_title">
    <h3>
      <a href="/blog/729271">Android编译，打包、签名详细教程</a>
      <em class="actions">      </em>
    </h3>
    <ul class='blog_categories'><strong>博客分类：</strong> <li><a href="/category/185660">android 开发</a></li> </ul>
        <div class='news_tag'><a href="http://www.iteye.com/blogs/tag/Android">Android</a><a href="http://www.iteye.com/blogs/tag/Eclipse">Eclipse</a><a href="http://www.iteye.com/blogs/tag/Java">Java</a><a href="http://www.iteye.com/blogs/tag/Ant">Ant</a><a href="http://www.iteye.com/blogs/tag/WordPress">WordPress</a></div>
  </div>

  <div id="blog_content" class="blog_content">
    <span style="color: indigo;"><span style="font-size: medium;"><div style="text-align: center;"><strong>Android编译，打包、签名详细教程</strong></div><br />Author：Jojol<br />Data:2010.08.04<br /><br /><strong>1.Android程序编译、打包、签名、发布的三种方式：</strong><br />方式一：命令行手动编译打包<br />方式二：使用ant自动编译打包<br />方式三：使用eclipse+ADT编译打包<br /><br /><strong>2.Android编译、打包的步骤：</strong><br /><em>2.1第一步 生成R.java类文件：</em><br />Eclipse中会自动生成R.java，ant和命令行使用android SDK提供的aapt.ext程序生成R.java。<br /><br /><em>2.2第二步 将.aidl文件生成.java类文件：</em><br />Eclipse中自动生成，ant和命令行使用android SDK提供的aidl.exe生成.java文件。<br /><br /><em>2.3第三步 编译.java类文件生成class文件：</em><br />Eclipse中自动生成，ant和命令行使用jdk的javac编译java类文件生成class文件。<br /><br /><em>2.4第四步 将class文件打包生成classes.dex文件：</em><br />Eclipse中自动生成,ant和命令行使用android SDK提供的dx.bat命令行脚本生成classes.dex文件。<br /><br /><em>2.5第五步 打包资源文件（包括res、assets、androidmanifest.xml等）：</em><br />Eclipse中自动生成,ant和命令行使用Android SDK提供的aapt.exe生成资源包文件。<br /><br /><em>2.6第六步 生成未签名的apk安装文件：</em><br />Eclipse中自动生成debug签名文件存放在bin目录中，ant和命令行使用android SDK提供的apkbuilder.bat命令脚本生成未签名的apk安装文件。<br /><br /><em>2.7第七步 对未签名的apk进行签名生成签名后的android文件：</em><br />Eclipse中使用Android Tools进行签名，ant和命令行使用jdk的jarsigner对未签名的包进行apk签名。<br /><br /><img src="http://dl.iteye.com/upload/attachment/288325/ee45e498-97d2-3d40-87c3-5c4247cb2ff8.png" /><br /><br /><br /><strong>3.命令行手动编译打包详解<br />详见：<a target="_blank" href="http://jojol-zhou.iteye.com/blog/729254">http://jojol-zhou.iteye.com/blog/729254</a></strong><br /><br /><strong>4.ant自动打包android程序详解</strong><br /><em>4.1生成R.java类文件：</em><br />&nbsp;&nbsp;&nbsp; &lt;!-- Generate the R.java file for this project's resources. --&gt;<br />&nbsp;&nbsp;&nbsp; &lt;target name="resource-src" depends="copy"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;echo&gt;Generating R.java / Manifest.java from the resources...&lt;/echo&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;exec executable="${aapt}" failonerror="true"&gt;<br />		&lt;arg value="package" /&gt;<br />		&lt;arg value="-m" /&gt;<br />		&lt;arg value="-J" /&gt;<br />		&lt;arg value="${outdir-gen}" /&gt;<br />		&lt;arg value="-M" /&gt;<br />		&lt;arg value="AndroidManifest.xml" /&gt;<br />		&lt;arg value="-S" /&gt;<br />		&lt;arg value="${resource-dir}" /&gt;<br />		&lt;arg value="-I" /&gt;<br />		&lt;arg value="${android-jar}" /&gt;<br />	&lt;/exec&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/target&gt;<br /><br /><em>4.2将.aidl文件生成.java类文件：</em><br />&nbsp;&nbsp;&nbsp; &lt;!-- Generate java classes from .aidl files. --&gt;<br />&nbsp;&nbsp;&nbsp; &lt;target name="aidl" depends="copy"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;echo&gt;Compiling aidl files into Java classes...&lt;/echo&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;apply executable="${aidl}" failonerror="true"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="-p${android-framework}" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="-I${srcdir}" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;fileset dir="${srcdir}"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;include name="**/*.aidl"/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/fileset&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/apply&gt;<br />&lt;/target&gt;<br /><br /><em>4.3编译.java类文件生成class文件：</em><br />&nbsp;&nbsp;&nbsp; &lt;!-- Compile this project's .java files into .class files. --&gt;<br />&nbsp;&nbsp;&nbsp; &lt;target name="compile" depends="copy, resource-src, aidl"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;javac encoding="GB18030" target="1.5" debug="true" extdirs=""<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; srcdir="."<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; destdir="${outdir-classes}"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bootclasspath="${android-jar}"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;classpath&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;fileset dir="${external-libs}" includes="*.jar"/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/classpath&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/javac&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/target&gt;<br />&nbsp;&nbsp; <br /><em>4.4第四步 将class文件打包生成classes.dex文件：</em><br />&nbsp;&nbsp;&nbsp; &lt;!-- Convert this project's .class files into .dex files. --&gt;<br />&nbsp;&nbsp;&nbsp; &lt;target name="dex" depends="compile"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;echo&gt;Converting compiled files and external libraries into ${outdir}/${dex-file}...&lt;/echo&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;apply executable="${dx}" failonerror="true" parallel="true"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="--dex" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="--output=${intermediate-dex-ospath}" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg path="${outdir-obfuscate-classes-ospath}" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;fileset dir="${external-libs}" includes="*.jar"/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/apply&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/target&gt;<br /><em>4.5第五步 打包资源文件（包括res、assets、androidmanifest.xml等）：</em><br />&nbsp;&nbsp; &lt;!-- Put the project's resources into the output package file. --&gt;<br />&nbsp;&nbsp;&nbsp; &lt;target name="package-res-and-assets"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;echo&gt;Packaging resources and assets...&lt;/echo&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;exec executable="${aapt}" failonerror="true"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="package" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="-f" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="-M" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="AndroidManifest.xml" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="-S" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="${resource-dir}" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="-A" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="${asset-dir}" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="-I" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="${android-jar}" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="-F" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="${resources-package}" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/exec&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/target&gt;<br /><em>4.6第六步 生成未签名的apk安装文件：</em><br />&nbsp;&nbsp; &lt;target name="package" depends="dex, package-res"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;echo&gt;Packaging ${out-unsigned-package} for release...&lt;/echo&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;exec executable="${apk-builder}" failonerror="true"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="${out-unsigned-package-ospath}" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="-u" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="-z" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="${resources-package-ospath}" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="-f" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="${intermediate-dex-ospath}" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="-rf" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="${srcdir-ospath}" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="-rj" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;arg value="${external-libs-ospath}" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/exec&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;echo&gt;It will need to be signed with jarsigner before being published.&lt;/echo&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/target&gt;<br />&nbsp;&nbsp;&nbsp; <br /><em>4.7第七步 对未签名的apk进行签名生成签名后的android文件：</em><br />	&lt;target name="jarsigner" depends="package"&gt;<br />			&lt;echo&gt;Packaging ${out-unsigned-package} for release...&lt;/echo&gt;<br />			&lt;exec executable="${jarsigner}" failonerror="true"&gt;<br />				&lt;arg value="-verbose" /&gt;<br />				&lt;arg value="-storepass" /&gt;<br />				&lt;arg value="byread002" /&gt;<br />				&lt;arg value="-keypass" /&gt;<br />				&lt;arg value="byread002" /&gt;<br />				&lt;arg value="-keystore" /&gt;<br />				&lt;arg value="bbyread.keystore" /&gt;<br />				&lt;arg value="-signedjar" /&gt;<br />				&lt;arg value="${out-signed-package-ospath}" /&gt;<br />				&lt;arg value="${out-unsigned-package-ospath}" /&gt;<br />				&lt;arg value="byread" /&gt;<br />			&lt;/exec&gt;<br />		&lt;/target&gt;<br /></span></span><br /><pre class="java" name="code">
&lt;?xml version="1.0" ?&gt;
	&lt;!--
  byread Package Utility
  Author: Jojol Zhou
  Date: 20100804
	--&gt;
&lt;project name="Byread" default="debug"&gt;
    &lt;!-- SDK Locations --&gt;
    &lt;property name="sdk2.2-folder" value="F:\explorer\android-sdk-windows2.2" /&gt;
    &lt;property name="sdk-folder" value="${sdk2.2-folder}/platforms/android-3" /&gt;
    &lt;property name="sdk-tools" value="${sdk-folder}/tools" /&gt;
    &lt;property name="android-tools" value="${sdk2.2-folder}/tools" /&gt;
    &lt;property name="proguardpath" location="${wtkhome}/lib/proguard" /&gt;

		&lt;!-- step 1.generate R.java by aapt  2.compile java to class by javac。exe 3.generate classes.dex by dx.bat  --&gt;
		&lt;!-- 4.package resources by aapt 5. package resource and classes.dex by apkbuilder.bat 6.sign apk by jarsinger --&gt;
    &lt;!-- Tools --&gt;
    &lt;property name="aapt" value="${sdk-tools}/aapt.exe" /&gt;
    &lt;property name="dx" value="${sdk-tools}/dx.bat" /&gt;
    &lt;property name="apk-builder" value="${android-tools}/apkbuilder.bat" /&gt;
    &lt;property name="aidl" value="${android-tools}/aidl.exe" /&gt;
    &lt;property name="adb" value="${android-tools}/adb.exe" /&gt;
    &lt;property name="android-jar" value="${sdk-folder}/android.jar" /&gt;
    &lt;property name="jarsigner" value="C:\Program Files\Java\jdk1.6.0_07\bin\jarsigner.exe" /&gt;

    &lt;!-- Application Package Name --&gt;
    &lt;property name="application-package" value="com.byread.reader" /&gt;
    &lt;property name="useragent" value="byAndroidWeb" /&gt;
    &lt;property name="version" value="1.02" /&gt;
    &lt;!-- The intermediates directory --&gt;
    &lt;!-- Eclipse uses "bin" for its own output, so we do the same. --&gt;
    &lt;property name="outdir-bin" value="bin" /&gt;
    &lt;property name="outdir-gen" value="gen" /&gt;
    &lt;!-- source directories --&gt;
		&lt;property name="resource-dir" value="res" /&gt;
    &lt;property name="asset-dir" value="assets" /&gt;
    &lt;property name="srcdir" value="src" /&gt;
    &lt;property name="srcdir-ospath" value="${basedir}/${srcdir}" /&gt;
    &lt;property name="external-libs" value="libs" /&gt;
    &lt;property name="external-libs-ospath" value="${basedir}/${external-libs}" /&gt;
    
    &lt;!-- dest directories --&gt;
    &lt;property name="des-resource-dir" value="${outdir-bin}/res" /&gt;
    &lt;property name="des-asset-dir" value="${outdir-bin}/assets" /&gt;
    &lt;property name="des-srcdir" value="${outdir-bin}/src" /&gt;
    &lt;property name="des-srcdir-ospath" value="${basedir}/${outdir-bin}/${srcdir}" /&gt;
    &lt;property name="des-external-libs" value="${outdir-bin}/libs" /&gt;
    &lt;property name="des-external-libs-ospath" value="${basedir}/${outdir-bin}/${external-libs}" /&gt;
    
    &lt;!-- Output directories --&gt;
    &lt;property name="outdir-classes" value="${outdir-bin}/src" /&gt;
    &lt;property name="outdir-obfuscate-classes" value="${outdir-bin}/classes" /&gt;
    &lt;property name="outdir-obfuscate-classes-ospath" value="${basedir}/${outdir-obfuscate-classes}" /&gt;

    &lt;!-- Intermediate files --&gt;
    &lt;property name="dex-file" value="classes.dex" /&gt;
    &lt;property name="intermediate-dex" value="${outdir-bin}/${dex-file}" /&gt;
    &lt;property name="intermediate-dex-ospath" value="${basedir}/${intermediate-dex}" /&gt;

    &lt;!-- The final package file to generate --&gt;
    &lt;property name="resources-package" value="${outdir-bin}/${ant.project.name}" /&gt;
    &lt;property name="resources-package-ospath" value="${basedir}/${resources-package}" /&gt;
    &lt;property name="out-debug-package" value="${outdir-bin}/${ant.project.name}-debug.apk" /&gt;
    &lt;property name="out-debug-package-ospath" value="${basedir}/${out-debug-package}" /&gt;
    &lt;property name="out-unsigned-package" value="${outdir-bin}/${ant.project.name}-unsigned.apk" /&gt;
    &lt;property name="out-unsigned-package-ospath" value="${basedir}/${out-unsigned-package}" /&gt;
		&lt;property name="out-signed-package" value="${useragent}\${ant.project.name}.apk" /&gt;
		&lt;property name="out-signed-package-ospath" value="${basedir}\${out-signed-package}" /&gt;
		

    &lt;!-- init --&gt;
		&lt;target name="init"&gt;
        &lt;echo&gt;Creating all output directories &lt;/echo&gt;
        &lt;delete dir="${outdir-bin}" /&gt;
        &lt;delete dir="${useragent}" /&gt;
        &lt;mkdir dir="${outdir-bin}" /&gt;
        &lt;mkdir dir="${outdir-classes}" /&gt;
        &lt;mkdir dir="${useragent}" /&gt;
    &lt;/target&gt;
    
    &lt;!-- copy original strings and modify useragent --&gt;
    &lt;target name="copy" depends="init"&gt;
        &lt;echo&gt;copy files to output folder&lt;/echo&gt;
        &lt;delete file="${resource-dir}\values\strings.xml"/&gt;
        &lt;copy file="strings.xml" todir="${resource-dir}\values" /&gt;
        &lt;replace file="${resource-dir}\values\strings.xml" token="@USERAGENT@" value="${useragent}" encoding="utf-8"/&gt;
    &lt;/target&gt;

    &lt;!-- Generate the R.java file for this project's resources. --&gt;
    &lt;target name="resource-src" depends="copy"&gt;
        &lt;echo&gt;Generating R.java / Manifest.java from the resources...&lt;/echo&gt;
        &lt;exec executable="${aapt}" failonerror="true"&gt;
					&lt;arg value="package" /&gt;
					&lt;arg value="-m" /&gt;
					&lt;arg value="-J" /&gt;
					&lt;arg value="${outdir-gen}" /&gt;
					&lt;arg value="-M" /&gt;
					&lt;arg value="AndroidManifest.xml" /&gt;
					&lt;arg value="-S" /&gt;
					&lt;arg value="${resource-dir}" /&gt;
					&lt;arg value="-I" /&gt;
					&lt;arg value="${android-jar}" /&gt;
				&lt;/exec&gt;
    &lt;/target&gt;

    &lt;!-- Generate java classes from .aidl files. --&gt;
    &lt;target name="aidl" depends="copy"&gt;
        &lt;echo&gt;Compiling aidl files into Java classes...&lt;/echo&gt;
        &lt;apply executable="${aidl}" failonerror="true"&gt;
            &lt;arg value="-p${android-framework}" /&gt;
            &lt;arg value="-I${srcdir}" /&gt;
            &lt;fileset dir="${srcdir}"&gt;
                &lt;include name="**/*.aidl"/&gt;
            &lt;/fileset&gt;
        &lt;/apply&gt;
    &lt;/target&gt;

    &lt;!-- Compile this project's .java files into .class files. --&gt;
    &lt;target name="compile" depends="copy, resource-src, aidl"&gt;
        &lt;javac encoding="GB18030" target="1.5" debug="true" extdirs=""
                srcdir="."
                destdir="${outdir-classes}"
                bootclasspath="${android-jar}"&gt;
            &lt;classpath&gt;
                &lt;fileset dir="${external-libs}" includes="*.jar"/&gt;
            &lt;/classpath&gt;
         &lt;/javac&gt;
    &lt;/target&gt;
    



    &lt;!-- Convert this project's .class files into .dex files. --&gt;
    &lt;target name="dex" depends="compile"&gt;
        &lt;echo&gt;Converting compiled files and external libraries into ${outdir}/${dex-file}...&lt;/echo&gt;
        &lt;apply executable="${dx}" failonerror="true" parallel="true"&gt;
            &lt;arg value="--dex" /&gt;
            &lt;arg value="--output=${intermediate-dex-ospath}" /&gt;
            &lt;arg path="${outdir-obfuscate-classes-ospath}" /&gt;
            &lt;fileset dir="${external-libs}" includes="*.jar"/&gt;
        &lt;/apply&gt;
    &lt;/target&gt;

    &lt;!-- Put the project's resources into the output package file. --&gt;
    &lt;target name="package-res-and-assets"&gt;
        &lt;echo&gt;Packaging resources and assets...&lt;/echo&gt;
        &lt;exec executable="${aapt}" failonerror="true"&gt;
            &lt;arg value="package" /&gt;
            &lt;arg value="-f" /&gt;
            &lt;arg value="-M" /&gt;
            &lt;arg value="AndroidManifest.xml" /&gt;
            &lt;arg value="-S" /&gt;
            &lt;arg value="${resource-dir}" /&gt;
            &lt;arg value="-A" /&gt;
            &lt;arg value="${asset-dir}" /&gt;
            &lt;arg value="-I" /&gt;
            &lt;arg value="${android-jar}" /&gt;
            &lt;arg value="-F" /&gt;
            &lt;arg value="${resources-package}" /&gt;
        &lt;/exec&gt;
    &lt;/target&gt;

    &lt;!-- Same as package-res-and-assets, but without "-A ${asset-dir}" --&gt;
    &lt;target name="package-res-no-assets"&gt;
        &lt;echo&gt;Packaging resources...&lt;/echo&gt;
        &lt;exec executable="${aapt}" failonerror="true"&gt;
            &lt;arg value="package" /&gt;
            &lt;arg value="-f" /&gt;
            &lt;arg value="-M" /&gt;
            &lt;arg value="AndroidManifest.xml" /&gt;
            &lt;arg value="-S" /&gt;
            &lt;arg value="${resource-dir}" /&gt;
            &lt;!-- No assets directory --&gt;
            &lt;arg value="-I" /&gt;
            &lt;arg value="${android-jar}" /&gt;
            &lt;arg value="-F" /&gt;
            &lt;arg value="${resources-package}" /&gt;
        &lt;/exec&gt;
    &lt;/target&gt;

    &lt;!-- Invoke the proper target depending on whether or not
         an assets directory is present. --&gt;
    &lt;!-- TODO: find a nicer way to include the "-A ${asset-dir}" argument
         only when the assets dir exists. --&gt;
    &lt;target name="package-res"&gt;
        &lt;available file="${asset-dir}" type="dir"
                property="res-target" value="and-assets" /&gt;
        &lt;property name="res-target" value="no-assets" /&gt;
        &lt;antcall target="package-res-${res-target}" /&gt;
    &lt;/target&gt;

    &lt;!-- Package the application and sign it with a debug key.
		 This is the default target when building. It is used for debug. --&gt;
    &lt;target name="debug" depends="dex, package-res"&gt;
        &lt;echo&gt;Packaging ${out-debug-package}, and signing it with a debug key...&lt;/echo&gt;
        &lt;exec executable="${apk-builder}" failonerror="true"&gt;
            &lt;arg value="${out-debug-package-ospath}" /&gt;
            &lt;arg value="-z" /&gt;
            &lt;arg value="${resources-package-ospath}" /&gt;
            &lt;arg value="-f" /&gt;
            &lt;arg value="${intermediate-dex-ospath}" /&gt;
            &lt;arg value="-rf" /&gt;
            &lt;arg value="${srcdir-ospath}" /&gt;
            &lt;arg value="-rj" /&gt;
            &lt;arg value="${external-libs-ospath}" /&gt;
        &lt;/exec&gt;
    &lt;/target&gt;

    &lt;!-- Package the application without signing it.
    	 This allows for the application to be signed later with an official publishing key. --&gt;
    &lt;target name="package" depends="dex, package-res"&gt;
        &lt;echo&gt;Packaging ${out-unsigned-package} for release...&lt;/echo&gt;
        &lt;exec executable="${apk-builder}" failonerror="true"&gt;
            &lt;arg value="${out-unsigned-package-ospath}" /&gt;
            &lt;arg value="-u" /&gt;
            &lt;arg value="-z" /&gt;
            &lt;arg value="${resources-package-ospath}" /&gt;
            &lt;arg value="-f" /&gt;
            &lt;arg value="${intermediate-dex-ospath}" /&gt;
            &lt;arg value="-rf" /&gt;
            &lt;arg value="${srcdir-ospath}" /&gt;
            &lt;arg value="-rj" /&gt;
            &lt;arg value="${external-libs-ospath}" /&gt;
        &lt;/exec&gt;
        &lt;echo&gt;It will need to be signed with jarsigner before being published.&lt;/echo&gt;
    &lt;/target&gt;
    
		&lt;target name="jarsigner" depends="package"&gt;
			&lt;echo&gt;Packaging ${out-unsigned-package} for release...&lt;/echo&gt;
			&lt;exec executable="${jarsigner}" failonerror="true"&gt;
				&lt;arg value="-verbose" /&gt;
				&lt;arg value="-storepass" /&gt;
				&lt;arg value="byread002" /&gt;
				&lt;arg value="-keypass" /&gt;
				&lt;arg value="byread002" /&gt;
				&lt;arg value="-keystore" /&gt;
				&lt;arg value="bbyread.keystore" /&gt;
				&lt;arg value="-signedjar" /&gt;
				&lt;arg value="${out-signed-package-ospath}" /&gt;
				&lt;arg value="${out-unsigned-package-ospath}" /&gt;
				&lt;arg value="byread" /&gt;
			&lt;/exec&gt;
		&lt;/target&gt;
		
		&lt;target name="release" depends="jarsigner"&gt;
        &lt;echo&gt;release for release...&lt;/echo&gt;
    &lt;/target&gt;
	
    &lt;!-- Install the package on the default emulator --&gt;
    &lt;target name="install" depends="debug"&gt;
        &lt;echo&gt;Installing ${out-debug-package} onto default emulator...&lt;/echo&gt;
        &lt;exec executable="${adb}" failonerror="true"&gt;
            &lt;arg value="install" /&gt;
            &lt;arg value="${out-debug-package}" /&gt;
        &lt;/exec&gt;
    &lt;/target&gt;

    &lt;target name="reinstall" depends="debug"&gt;
        &lt;echo&gt;Installing ${out-debug-package} onto default emulator...&lt;/echo&gt;
        &lt;exec executable="${adb}" failonerror="true"&gt;
            &lt;arg value="install" /&gt;
            &lt;arg value="-r" /&gt;
            &lt;arg value="${out-debug-package}" /&gt;
        &lt;/exec&gt;
    &lt;/target&gt;

    &lt;!-- Uinstall the package from the default emulator --&gt;
    &lt;target name="uninstall"&gt;
        &lt;echo&gt;Uninstalling ${application-package} from the default emulator...&lt;/echo&gt;
        &lt;exec executable="${adb}" failonerror="true"&gt;
            &lt;arg value="uninstall" /&gt;
            &lt;arg value="${application-package}" /&gt;
        &lt;/exec&gt;
    &lt;/target&gt;

&lt;/project&gt;

</pre><br /><strong>5.eclipse打包签名<br />详见：<a target="_blank" href="http://jojol-zhou.iteye.com/blog/719428">http://jojol-zhou.iteye.com/blog/719428</a></strong><br /><br /><br />参考：<a target="_blank" href="http://sinfrancis.iteye.com/blog/721582">http://sinfrancis.iteye.com/blog/721582</a><br /><a target="_blank" href="http://asantoso.wordpress.com/2009/09/15/how-to-build-android-application-package-apk-from-the-command-line-using-the-sdk-tools-continuously-integrated-using-cruisecontrol/">http://asantoso.wordpress.com/2009/09/15/how-to-build-android-application-package-apk-from-the-command-line-using-the-sdk-tools-continuously-integrated-using-cruisecontrol/</a> <br />
  </div>

  
  <div class="attachments">
    
      
        <ul style="display:none;">
          <li><a href="http://dl2.iteye.com/upload/attachment/0028/8325/ee45e498-97d2-3d40-87c3-5c4247cb2ff8.png" target="_blank"><img src='http://dl2.iteye.com/upload/attachment/0028/8325/ee45e498-97d2-3d40-87c3-5c4247cb2ff8-thumb.png' class='magplus' title='点击查看原始大小图片' /></a></li>
          
          <li>大小: 104.5 KB</li>
        </ul>
      
    
    
      <ul>
        <li><a href="#" onclick="$$('div.attachments ul').invoke('show');$(this).up(1).hide();return false;">查看图片附件</a></li>
      </ul>
    
  </div>



  <IFRAME SRC="/iframe_ggbd/794" SCROLLING=no WIDTH=468 HEIGHT=60 FRAMEBORDER=0></IFRAME>
  
  <div id="bottoms" class="clearfix">
    <div id="digg_bottom" class="clearfix"><div class='digged'><strong>2</strong> <br/>顶</div><div class='digged'><strong>0</strong> <br/>踩</div></div>
    <div id="share_weibo">分享到：
      <a data-type='sina' href="javascript:;" title="分享到新浪微博"><img src="/images/sina.jpg"></a>
      <a data-type='qq' href="javascript:;" title="分享到腾讯微博"><img src="/images/tec.jpg"></a>
    </div>
  </div>

  <div class="blog_nav">
    <div class="pre_next">
      <a href="/blog/737309" class="next" title="互联网进入网盘新时代">互联网进入网盘新时代</a>
      |
      <a href="/blog/729254" class="pre" title="原：Android 命令行手动编译打包详解">原：Android 命令行手动编译打包详解</a>
    </div>
  </div>
  <div class="blog_bottom">
    <ul>
      <li>2010-08-04 22:19</li>
      <li>浏览 12903</li>
      <li><a href="#comments">评论(1)</a></li>
      
      
      <li>分类:<a href="http://www.iteye.com/blogs/category/mobile">移动开发</a></li>      
      <li class='last'><a href="http://www.iteye.com/wiki/blog/729271" target="_blank" class="more">相关推荐</a></li>
    </ul>
  </div>

  <div class="blog_comment">
    <h5>评论</h5>
    <a id="comments" name="comments"></a>
    <div id="bc2233978">
  <div class="comment_title">
    1 楼
    <a href='http://serryzhao.iteye.com' target='_blank' title='serryzhao'>serryzhao</a>
    2011-12-07&nbsp;&nbsp;
    
    
  </div>
  <div class="comment_content">大哥如果libs下 armeabi 包含so文件你怎处理呢？</div>
</div>


    
    
  </div>

  <div class="blog_comment">
    <h5>发表评论</h5>
            <p style="text-align:center; margin-top:30px;margin-bottom:0px;"><a href="/login" style="background-color:white;"> <img src="/images/login_icon.png" style="vertical-align:middle; margin-right: 10px;" /></a><a href="/login">  您还没有登录,请您登录后再发表评论 </a></p>
      </div>
</div>


<script type="text/javascript">
  dp.SyntaxHighlighter.HighlightAll('code', true, true);

  $$('#main .blog_content pre[name=code]').each(function(pre, index){ // blog content
    var post_id = 729271;
    var location = window.location;
    source_url = location.protocol + "//" + location.host + location.pathname + location.search;
    pre.writeAttribute('codeable_id', post_id);
    pre.writeAttribute('codeable_type', "Blog");
    pre.writeAttribute('source_url', source_url);
    pre.writeAttribute('pre_index', index);
    pre.writeAttribute('title', 'Android编译，打包、签名详细教程');
  });

  fix_image_size($$('div.blog_content img'), 700);

  function processComment() {
    $$('#main .blog_comment > div').each(function(comment){// comment
      var post_id = comment.id.substr(2);
      $$("#"+comment.id+" pre[name=code]").each(function(pre, index){
        var location = window.location;
        source_url = location.protocol + "//" + location.host + location.pathname + location.search;
        source_url += "#" + comment.id;
        pre.writeAttribute('codeable_id', post_id);
        pre.writeAttribute('codeable_type', "BlogComment");
        pre.writeAttribute('source_url', source_url);
        pre.writeAttribute('pre_index', index);
        pre.writeAttribute('title', 'Android编译，打包、签名详细教程');
      });
    });
  }

  function quote_comment(id) {
    new Ajax.Request('/editor/quote', {
      parameters: {'id':id, 'type':'BlogComment'},
      onSuccess:function(response){editor.bbcode_editor.textarea.insertAfterSelection(response.responseText);
        Element.scrollTo(editor.bbcode_editor.textarea.element);}
    });
  }

  code_favorites_init();
  processComment();
  new WeiboShare({share_buttons: $('share_weibo'), img_scope: $('blog_content')});
</script>




        </div>

        <div id="local">
          <div class="local_top"></div>
          <div id="blog_owner">
  <div id="blog_owner_logo"><a href='http://jojol-zhou.iteye.com'><img alt="jojol_zhou的博客" class="logo" src="http://www.iteye.com/images/user-logo.gif?1324994303" title="jojol_zhou的博客: Jojol's blog" /></a></div>
  <div id="blog_owner_name">jojol_zhou</div>
</div>

          <div id="blog_actions">
            <ul>
              <li>浏览: 150006 次</li>
              <li>性别: <img alt="Icon_minigender_1" src="http://www.iteye.com/images/icon_minigender_1.gif?1324994303" title="男" /></li>
              <li>来自: 南京</li>
              <li><img src='/images/status/offline.gif'/></li>
              
            </ul>
          </div>
          <div id="user_visits" class="clearfix">
            <h5>最近访客 <span style='font-weight:normal;font-size:12px;padding-left:30px;'><a href="/blog/user_visits">更多访客&gt;&gt;</a></span></h5>
            
              <div class="user_visit">
                <div class="logo"><a href='http://qqsheji.iteye.com' target='_blank'><img alt="qqsheji的博客" class="logo" src="http://www.iteye.com/images/user-logo-thumb.gif?1324994303" title="qqsheji的博客: " /></a></div>
                <div class="left"><a href='http://qqsheji.iteye.com' target='_blank' title='qqsheji'>qqsheji</a></div>
              </div>
            
              <div class="user_visit">
                <div class="logo"><a href='http://mike-liu.iteye.com' target='_blank'><img alt="mike.liu的博客" class="logo" src="http://www.iteye.com/images/user-logo-thumb.gif?1324994303" title="mike.liu的博客: " /></a></div>
                <div class="left"><a href='http://mike-liu.iteye.com' target='_blank' title='mike.liu'>mike.liu</a></div>
              </div>
            
              <div class="user_visit">
                <div class="logo"><a href='http://kymjs123.iteye.com' target='_blank'><img alt="kym僵尸的博客" class="logo" src="http://www.iteye.com/images/user-logo-thumb.gif?1324994303" title="kym僵尸的博客: " /></a></div>
                <div class="left"><a href='http://kymjs123.iteye.com' target='_blank' title='kym僵尸'>kym僵尸</a></div>
              </div>
            
              <div class="user_visit">
                <div class="logo"><a href='http://dylinshi126.iteye.com' target='_blank'><img alt="dylinshi126的博客" class="logo" src="http://www.iteye.com/images/user-logo-thumb.gif?1324994303" title="dylinshi126的博客: " /></a></div>
                <div class="left"><a href='http://dylinshi126.iteye.com' target='_blank' title='dylinshi126'>dylinshi126</a></div>
              </div>
            
          </div>

          

                      <div id="blog_menu">
              <h5>文章分类</h5>
              <ul>
                <li><a href="/">全部博客 (50)</a></li>
                
                  <li><a href="/category/185660">android 开发 (17)</a></li>
                
              </ul>
            </div>
            <div id='month_blogs'>
              <h5>社区版块</h5>
              <ul>
                <li><a href="/blog/news">我的资讯</a> (0)</li>
                <li>
                  <a href="/blog/post">我的论坛</a> (1)
                </li>
                <li><a href="/blog/answered_problems">我的问答</a> (0)</li>
              </ul>
            </div>
            <div id="month_blogs">
              <h5>存档分类</h5>
              <ul>
                
                  <li><a href="/blog/monthblog/2012-10">2012-10</a> (1)</li>
                
                  <li><a href="/blog/monthblog/2012-03">2012-03</a> (1)</li>
                
                  <li><a href="/blog/monthblog/2012-02">2012-02</a> (2)</li>
                
                <li><a href="/blog/monthblog_more">更多存档...</a></li>
              </ul>
            </div>
            
            

            <div id="guest_books">
              <h5>最新评论</h5>
              <ul>
                
                <li>
                  <a href='http://2006003845.iteye.com' target='_blank' title='2006003845'>2006003845</a>： 
                  ghlimbrother 写道用这种方法怎么把so文件打包进去 ...<br />
                  <a href="/blog/729254#bc2339185">原：Android 命令行手动编译打包详解</a>
                </li>
                
                <li>
                  <a href='http://2006003845.iteye.com' target='_blank' title='2006003845'>2006003845</a>： 
                  你好 请问下 如果项目中  libs/  有jar 包 有.s ...<br />
                  <a href="/blog/729254#bc2339157">原：Android 命令行手动编译打包详解</a>
                </li>
                
                <li>
                  <a href='http://shiyanshiguize.iteye.com' target='_blank' title='shiyanshiguize'>shiyanshiguize</a>： 
                  楼主在吗？我在执行第一步：使用aapt生成R.java类文件： ...<br />
                  <a href="/blog/729254#bc2335875">原：Android 命令行手动编译打包详解</a>
                </li>
                
                <li>
                  <a href='http://iwso.iteye.com' target='_blank' title='IWSo'>IWSo</a>： 
                  测试代码写什么方法里？<br />
                  <a href="/blog/828830#bc2333910">原：Android 获取屏幕高度、标题高度、状态栏高度详解</a>
                </li>
                
                <li>
                  <a href='http://a13525177343.iteye.com' target='_blank' title='a13525177343'>a13525177343</a>： 
                  楼主今天查看build.xml的作用的时候,看见你的博文的,我 ...<br />
                  <a href="/blog/729254#bc2326980">原：Android 命令行手动编译打包详解</a>
                </li>
                
              </ul>
            </div>

            <div class="local_bottom"></div>
          
        </div>
      </div>

      <div id="footer" class="clearfix">
        <div id="copyright">
          <hr/>
          声明：ITeye文章版权属于作者，受法律保护。没有作者书面许可不得转载。若作者同意转载，必须以超链接形式标明文章原始出处和作者。<br />
          &copy; 2003-2014 ITeye.com.   All rights reserved.  [ 京ICP证110151号  京公网安备110105010620 ]
        </div>
      </div>
    </div>
    <script type="text/javascript">
  document.write("<img src='http://stat.iteye.com/?url="+ encodeURIComponent(document.location.href) + "&referrer=" + encodeURIComponent(document.referrer) + "&user_id=' width='0' height='0' />");
</script>

<script src="http://csdnimg.cn/pubfooter/js/tracking.js?version=20130923164150" type="text/javascript"></script>

    
    
  </body>
</html>
